package com.yifi.module.common.controller;

import com.jfinal.core.Path;
import com.yifi.common.base.BaseController;

import cn.hutool.core.util.StrUtil;


@Path(value="/select_user",viewPath = "/")
public class select_user_controller extends BaseController {

	public void index()
	{
		render("common/select_user.html");
	}
	
	public void list()
	{
		String cdept=getPara("cdept","all");
		String cname=getPara("cname","");
		String sqlSelect="select * ";
		String sqlExcept=" from mis_user where 1=1 ";
		if(!cdept.equals("all"))
		{
			sqlExcept+=" and cdept='"+cdept+"'";
		}
		if(StrUtil.isNotEmpty(cname))
		{
			sqlExcept+=" and cname like '%"+cname+"%' ";
		}
		
		sqlExcept+=" order by cname  ";
		renderJson(getDataTable(sqlSelect, sqlExcept));
	}
}
